//class实现继承

// class Person {
//   constructor(name, age) {
//     this.name = name
//     this.age = age
//   }
//   jump() {
//     console.log('jump')
//   }
// }

// class Teacher extends Person {
//   constructor(name, age, lesson) {
//     super(name, age) // 执行父类的构造函数
//     this.lesson = lesson
//   }
//   sayhello() {
//     console.log('hi~~')
//   }
// }

// const teacher1 = new Teacher('jerry', 'tom', '12')
// console.log(teacher1)

class Person {
  constructor(name, age) {
    this.name = name
    this.age=age
  }
  jump() {
    console.log('i can jump')
  }
}

class Teacher extends Person {
  constructor(name, age, lesson) {
    super(name, age)
    this.lesson=lesson
  }
  sayHi() {
    console.log('hello~~')
  }
}